/*****************************************************************************************
 * FILE NAME: drv_rtc                      COPYRIGHT (c) cos 2024
 * REVISION:  1.0.0                                     All Rights Reserved
 * DESCRIPTION:
 * =======================================================================================
 * UPDATE HISTORY:
 * REV      AUTHOR      DATE
 * v1.0.0   Tuxin       2024.10.14
 * DESCRIPTION OF CHANGE:
 ****************************************************************************************/
#ifndef __DRV_RTC_H
#define __DRV_RTC_H

//----------------------------------------------------------------------------------------
// @Project Includes
#include "typedefs.h"
#include "time.h"

//----------------------------------------------------------------------------------------
// @Global Macro Define in the module
#define    RTC_LSE_TRY_COUNT              (250)

//----------------------------------------------------------------------------------------
// @Global Type defines in the module
typedef enum en_rtc_clksrc
{
    RTC_CLK_SRC_TYPE_HSE_DIV32=0x01,
    RTC_CLK_SRC_TYPE_LSE=0x02,
    RTC_CLK_SRC_TYPE_LSI=0x03,
}en_rtc_clksrc_t;

//----------------------------------------------------------------------------------------
// @Export global Variables declare in the module

//----------------------------------------------------------------------------------------
// @Export declaration of functions in the module
void drv_rtc_setTime(uint8_t *pDay);
void drv_rtc_getTime(uint8_t *pTm);
char* drv_rtc_getCurTime(void);

void drv_rtc_sleep(void);
void drv_rtc_wakeup(void);
time_t drv_rtc_second(void);
void drv_rtc_init(void);
#endif

// =======================================================================================
// End of file.
// =======================================================================================
